cmake_minimum_required(VERSION 3.15)
project(Matching.marketprice)

message(STATUS "sourece:" ${PROJECT_SOURCE_DIR})
message(STATUS "bin    :" ${PROJECT_BINARY_DIR}/bin)

set (CMAKE_BUILD_TYPE Debug)
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -Wall -g -ggdb")

include_directories(
        /usr/include
        /usr/include/mysql
        .
        ../network
        ../utils
)

link_directories(
        /usr/local/lib
        ${PROJECT_BINARY_DIR}/lib
)

set(TARGET "marketprice.exe")
FILE(GLOB SRC_FILE_LIST "*.cpp")
add_executable(${TARGET} ${SRC_FILE_LIST})

add_dependencies(${TARGET}
        utils
        network)
target_link_libraries(${TARGET}
        utils.a
        network.a
        libev.a
        libhiredis.a
        libmpdec.a
        libjansson.a
        librdkafka.a
        libcurl.a
)

target_link_libraries(${TARGET}
        libz.so
        libssl.so
        mysqlclient
        libcrypto.so
        libm.so
        libpthread.so
        libdl.so
        sasl2
)

#安装路径(子目录)
#SET(INSTANNDIR "marketprice")
#INSTALL(TARGETS  ${TARGET}   DESTINATION ${INSTANNDIR})
#INSTALL(PROGRAMS restart.sh DESTINATION ${INSTANNDIR})
#INSTALL(PROGRAMS stop.sh  DESTINATION ${INSTANNDIR})
#INSTALL(FILES config_${PUBLISH_ENV}.json RENAME config.json DESTINATION ${INSTANNDIR})
